package org.dromara.iot.enums;

import lombok.Getter;

/**
 * 电瓶车状态枚举
 */
@Getter
public enum ElectricVehicleStatusEnum {
    NONE(0, "无"),
    PRESENT(1, "有");

    private final int code;
    private final String description;

    ElectricVehicleStatusEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    /**
     * 根据code获取枚举
     */
    public static ElectricVehicleStatusEnum getByCode(int code) {
        for (ElectricVehicleStatusEnum status : values()) {
            if (status.code == code) {
                return status;
            }
        }
        return null;
    }
}